package C;

import java.util.Arrays;
import java.util.Scanner;

public class C63 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.nextLine());
        int[] nums = Arrays.stream(sc.nextLine().split(" ")).mapToInt(Integer::parseInt).toArray();
        int threshold =Integer.parseInt(sc.nextLine());
        System.out.println(getResult(n,nums,threshold));
    }

    public static int getResult(int n,int[] nums,int threshold) {
        int left = 0,right = n-1;
        int count = 0;
        Arrays.sort(nums);
        while(left<=right) {
            if (nums[right]>=threshold) {
                count++;
                right--;
            } else {
                if (nums[left]+nums[right]>=threshold) {
                    count++;
                    left++;
                    right--;
                } else {
                    left++;
                }
            }
        }
        return count;
    }
}
